﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using System.Data.SqlClient;

namespace Xqsys.DAL
{
  public class News
    {
        /// <summary>
        /// 添加新闻
        /// </summary>
        /// <param name="news"></param>
        /// <returns></returns>
        public bool AddNews(MODEL.News news)
        {
            SqlParameter[] param = new SqlParameter[]
           {
               new SqlParameter("@newID",news.NewID),
               new SqlParameter("@title",news.Title),
               new SqlParameter("@typeID",news.TypeID),
               new SqlParameter("@keywords",news.Keywords),
               new SqlParameter("@summary",news.Summary),
               new SqlParameter("@content",news.Content),
               new SqlParameter("@userID",news.UserID),
               new SqlParameter("@intime",news.Intime),
               new SqlParameter("@hot",news.Hot),
               new SqlParameter("@state",news.State),
           };
           return COM.SqlHelper.ExecuteNonQuery("sp_AddNews",param);
        }
        /// <summary>
        /// 添加新闻审核人和时间
        /// </summary>
        /// <param name="news"></param>
        /// <returns></returns>
        public bool VerifyNews(MODEL.News news)
        {
            SqlParameter[] param = new SqlParameter[]
            {
                new SqlParameter("@manager",news.Manager),
                new SqlParameter("@operTime",news.OperTime)
            };
            return COM.SqlHelper.ExecuteNonQuery("sp_VerifyNew", param);
        }
    }
}
